<template>
  <div class="bg">
    <div class="top_nav">
      <span>设置签到时间</span>
      <van-icon
        name="arrow-left"
        size="25"
        class="return_tap"
        color="#fff"
        @click="returnTap"
      />
      <div class="btn" @click="btn">完成</div>
    </div>
<div class="main">
    <div class="list" v-for='(item,index) in list' :key="index" @click="onselect(index)">
        <span>{{item.title}}</span>
        <van-icon name="success" color='#06c25f' size='30' v-if="item.select" />
    </div>
</div>


  </div>
</template>
<script>
export default {
  data() {
    return {
      list:[{title:'每工作日',select:false},
      {title:'每周一',select:false},
      {title:'每周二',select:false},
      {title:'每周三',select:false},
      {title:'每周四',select:false},
      {title:'每周五',select:false},
      {title:'每周六',select:false},
      {title:'每周日',select:false}
     
      ]
    };
  },
  methods: {
    returnTap() {
      this.$router.go(-1);
    },
    onselect(index){
    this.list[index].select = !this.list[index].select
    },
    btn(){
     this.returnTap()
    },
    

  },
};
</script>
<style  scoped>
.bg {
  min-height: 100vh;
  background: #000;
}
.top_nav {
  display: flex;
  position: relative;
  justify-content: center;
  align-items: center;
  height: 50px;
  color: #fff;
}
.return_tap {
  position: absolute;
  left: 20px;
  top: 15px;
}
.btn {
  position: absolute;
  right: 20px;
  top: 15px;
  width: 50px;
  text-align: center;
  height: 28px;
  line-height: 28px;
  background: #06c25f;
  color: #fff;
  border-radius: 2px;
}
.main{
    background: #333333;
    margin-top: 30px;
    color: #fff;
}

.list{
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    margin-left: 10px;
    border-bottom: 1px solid #797979;
    padding-right: 30px;
}

</style>